#!/bin/bash
## use:
##    UAAC_ADMIN_PWD=<> uaac_admin_login

if [[ "x$UAAC_ADMIN_PWD" == "x" ]]; then
    echo "use:"
    echo "   UAAC_ADMIN_PWD=<password> uaac_admin_login"
    exit -1
fi

uaac target https://uaa.fin.cian.ru --skip-ssl-validation

uaac token client get admin -s ${UAAC_ADMIN_PWD}

## display short manual 
echo "Use uaac for:"
echo "    uaac users"
echo "    uaac users -a username | grep username   # short users list (only username)"
echo "    uaac user get <username>"
echo "    uaac user get <username> | grep display  # view user groups"
echo "    uaac member add network.admin <username> # add user <username> into group"
echo "    uaac user add [id] -p [passwd] --emails [user-email]"
echo "    uaac password set [name] [-p <password>]"
echo "    uaac clients"
echo "    uaac client update actuator-metrics-client --authorities “actuator.read, scim.read, scim.write, cloud_controller.admin”"
echo "    uaac target"
echo "    uaac context"